package com.woniu.controller;

import com.woniu.service.PermissionService;
import com.woniu.service.SysPermissionService;
import com.woniu.util.ResponseData;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @description 权限控制器
 * @createDate 2025年2月15日
 */
@RestController
@RequestMapping("/permission")
public class PermissionController {
    @Resource
    private SysPermissionService permissionService;
    /**
     * 初始化权限
     * */
    @GetMapping("/init")
    public ResponseData<?> initPermission() {
        return permissionService.initPermission();
    }
    /**
     * 导出权限信息到Excel
     * */
    @GetMapping("/outPermissionExcel")
    public ResponseData<?> outPermissionExcel(HttpServletResponse response) throws IOException {
        return permissionService.outPermissionExcel(response);
    }
    /**
     * 查询角色信息
     * */
    @GetMapping("/queryRoleList")
    public ResponseData<?> queryRoleList() {
        return permissionService.queryRoleList();
    }
}
